Revert "Add year to project template variables"
authorEwan Higgs <ewan_higgs@yahoo.co.uk>
Wed, 29 Mar 2017 19:50:53 +0000 (21:50 +0200)
committerEwan Higgs <ewan_higgs@yahoo.co.uk>
Wed, 29 Mar 2017 19:50:53 +0000 (21:50 +0200)
This reverts commit 69ffd99f4261b10414b882eed638f041e42d8f73.

Cargo.lock
Cargo.toml
src/cargo/ops/cargo_new.rs
src/doc/guide.md
tests/new.rs

index 29c96376d578ceb79f790dbc2ec1fd134d4e3f52..140f2aa2cc3ebe68a4adadd2709ff60fb0458e0f 100644 (file)
@@ -5,7 +5,7 @@ dependencies = [
  "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bufstream 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "cargotest 0.1.0",
- "crates-io 0.8.0",
+ "crates-io 0.7.0",
  "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -553,11 +553,6 @@ dependencies = [
  "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "redox_syscall"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "regex"
 version = "0.1.80"
@@ -732,17 +727,6 @@ dependencies = [
  "unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "time"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "toml"
 version = "0.2.1"
@@ -892,7 +876,6 @@ dependencies = [
 "checksum quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0aad603e8d7fb67da22dbdf1f4b826ce8829e406124109e73cf1b2454b93a71c"
 "checksum quote 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b44fd83db28b83c1c58187159934906e5e955c812e211df413b76b03c909a5"
 "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d"
-"checksum redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd35cc9a8bdec562c757e3d43c1526b5c6d2653e23e2315065bc25556550753"
 "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
 "checksum regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4278c17d0f6d62dfef0ab00028feb45bd7d2102843f80763474eeb1be8a10c01"
 "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
@@ -915,7 +898,6 @@ dependencies = [
 "checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a"
 "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
 "checksum thread_local 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7793b722f0f77ce716e7f1acf416359ca32ff24d04ffbac4269f44a4a83be05d"
-"checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade"
 "checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4"
 "checksum toml 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08272367dd2e766db3fa38f068067d17aa6a9dfd7259af24b3927db92f1e0c2f"
 "checksum unicode-bidi 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b61814f3e7fd0e0f15370f767c7c943e08bc2e3214233ae8f88522b334ceb778"
index 084958904715f06302f69a498d125509bc9d3cc4..91fcbd0dce6f655ed4b3eb46041f5a1c9fac5c7d 100644 (file)
@@ -17,7 +17,7 @@ name = "cargo"
 path = "src/cargo/lib.rs"
 
 [dependencies]
-crates-io = { path = "src/crates-io", version = "0.8" }
+crates-io = { path = "src/crates-io", version = "0.7" }
 crossbeam = "0.2"
 curl = "0.4.6"
 docopt = "0.7"
index d8faedf4da747b3e7a3cd54d0f04f8d1cba1c0d1..18a62c7fc4ad84917ae532497ebdd230947343f4 100644 (file)
@@ -521,7 +521,6 @@ fn mk(config: &Config, opts: &MkOptions) -> CargoResult<()> {
     let mut data = BTreeMap::new();
     data.insert("name".to_owned(), name.to_owned());
     data.insert("author".to_owned(), author);
-    data.insert("year".to_owned(), (time::now().tm_year + 1900).to_string());
 
     let template_set = try!(get_input_template(config, opts));
     for template in template_set.template_files.iter() {
@@ -584,7 +583,7 @@ fn collect_template_dir(template_path: &PathBuf, _: &Path) -> CargoResult<Vec<Bo
                                       human(format!("entry is somehow not a subpath \
                                                      of the directory being walked."))
                                   })));
-        templates.push(Box::new(InputFileTemplateFile::new(entry_path,
+        templates.push(Box::new(InputFileTemplateFile::new(entry_path, 
                                                            dest_file_name.to_path_buf())));
         Ok(())
     }));
index bdfa18d02ea63f2af5982ba690c69b61c55933d9..6949fe6afb1b40fe65c9f7ae650960608c4e92b0 100644 (file)
@@ -29,7 +29,7 @@ repository by default. If you don't want it to do that, pass `--vcs none`.
 
 You can also use your own template to scaffold cargo projects! See the
 [Templates](#templates) section for more details.
-
+  
 Let’s check out what Cargo has generated for us:
 
 ```shell
@@ -480,8 +480,7 @@ $ cargo new proj --template http://your/project/repo
 The variables available for use are:
 
 - `name`: the name of the project
-- `author`: the toml formatted name of the project author
-- `year`: the current year
+- `authors`: the toml formatted name of the project author
 
 In the future, more variables may be added. Suggestions welcome!
 
index bf406744fe85749aac1158d2d05e9dc80430d6f5..9f9d3ba299f0bb51b673891c85be758d31c44edb 100644 (file)
@@ -76,10 +76,6 @@ fn simple_template() {
 name = "{{name}}"
 version = "0.0.1"
 authors = ["{{author}}"]
-"#).unwrap();
-File::create(&root.join("home/.cargo/templates/testtemplate/LICENSE"))
-                  .unwrap().write_all(br#"
-(c) {{year}} {{author}}
 "#).unwrap();
     File::create(&root.join("home/.cargo/templates/testtemplate/src/main.rs"))
                       .unwrap().write_all(br#"
@@ -99,15 +95,8 @@ fn main () {
 
     assert_that(&paths::root().join("foo"), existing_dir());
     assert_that(&paths::root().join("foo/Cargo.toml"), existing_file());
-    assert_that(&paths::root().join("foo/LICENSE"), existing_file());
     assert_that(&paths::root().join("foo/src/main.rs"), existing_file());
 
-    let license = paths::root().join("foo/LICENSE");
-    let mut contents = String::new();
-    File::open(&license).unwrap().read_to_string(&mut contents).unwrap();
-    let expected = format!("(c) {} {}", (time::now().tm_year + 1900).to_string(), "foo");
-    assert!(contents.contains(&expected));
-
     assert_that(cargo_process("build").cwd(&paths::root().join("foo")),
                 execs().with_status(0));
     assert_that(&paths::root().join(&format!("foo/target/debug/foo{}",